<?php
session_start();
include("../includes/conn.php");
$dbconn->admin_logincheck();
$sql=" select * from ".DBQIAN."user where status=1 order by time desc limit 0, 60000";
$result = mysql_query($sql);
header ( "Content-type:application/vnd.ms-excel" );
header ( "Content-Disposition:filename=中奖名单.xls" );
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>中奖名单</title>
<style>
td{
    text-align:center;
    font-size:12px;
    font-family:Arial, Helvetica, sans-serif;
    border:#1C7A80 1px solid;
    color:#152122;
    width:100px;
}
table,tr{
    border-style:none;
}
.title{
    background:#7DDCF0;
    color:#FFFFFF;
    font-weight:bold;
}
</style>
</head>
 
<body>
<table width='800' border='1'>
  <tr>
    <td class='title' height='36'>姓名</td>
    <td class='title' style='width:100px;text-align:center;'>电话/手机号码</td>
    <td class='title'>省份</td>
    <td class='title'>城市</td>
    <td class='title'>详细地址</td>
    <td class='title'>车型</td>
    <td class='title'>IP</td>
    <td class='title'>抽奖时间</td>
    <td class='title' style='width:80px;text-align:center;'>是否中奖</td>
    <td class='title' style='width:80px;text-align:center;'>是否发放奖品</td>
  </tr>";
  
while($row=mysql_fetch_array($result))
{
  echo "<tr>
    <td height='36'>".$row['name']."</td>
    <td>".$row['tel']."</td>
    <td>".$row['province']."</td>
    <td>".$row['city']."</td>
    <td>".$row['address']."</td>
    <td>".$row['car_type']."</td>
    <td>".$row['ip']."</td>
    <td>".$row['time']."</td>
    <td>".$row['praise']."</td>
    <td>";
  		if ($row['sendstatus']==1)
  		{
  			echo '已发放';
  		}
  		else
  		{ 
  			echo '未发放';
  		};
  	echo "</td>
	</tr>";
}
echo "
</table>
</body>
</html>
";exit;
?>